import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, OneToMany } from "typeorm";
import { IsString, IsNotEmpty, IsArray, IsDefined, IsIn, IsInt, ArrayNotEmpty, ArrayUnique } from 'class-validator';
import { Article } from "../article/article.entity";

@Entity('category')
export class Category{
  /**
   * id
   */
  @PrimaryGeneratedColumn()
  id: number

  @IsNotEmpty({ message: '缺少参数？' })
  @IsString({ message: '名字格式不对？' })
  @Column({
    length: 40
  })
  name: string
}